#encoding:utf8  
import xxtea, base64 

class Crypto:
    @staticmethod
    def encode(tarstr , key):
        strxx = xxtea.encrypt(tarstr, key)
        return base64.b64encode(strxx)

    @staticmethod
    def decode(tarstr ,key):
        strxx = base64.b64decode(tarstr)
        return xxtea.decrypt(strxx, key)



if __name__ == "__main__":
    aa = Crypto.encode("111" , "aa")
    bb = Crypto.decode(aa, 'aa')